<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
	<template id="report.style" name="style">
           <style type="text/css">
               body {
               color: #000 !important;
               }
               .border-black td {
               border-top: 1px solid black !important;
               }
               .table-condensed > thead > tr > th {
               border-top: 1px solid black !important;
               border-bottom: 1px solid black !important;
               border-left: 1px solid black !important;
               border-right: 1px solid black !important;
               }
               .zero_min_height {
               min-height: 0px !important;
               }
               
               table {
			    counter-reset: rowNumber;
			 }
			
			table tr.kolum {
			    counter-increment: rowNumber;
			}
			
			table tr.kolum td:first-child::before {
			    content: counter(rowNumber);
			    min-width: 1em;
			    margin-right: 0.0em;
			}
			
			.border-all {
               border-top: 1px solid black !important;
               border-bottom: 1px solid black !important;
               border-left: 1px solid black !important;
               border-right: 1px solid black !important;
               }
               
			.border-LRB {
               border-bottom: 1px solid black !important;
               border-left: 1px solid black !important;
               border-right: 1px solid black !important;
               }
               
            .border-RTB {
               border-right: 1px solid black !important;
               border-top: 1px solid black !important;
               border-bottom: 1px solid black !important;
               }
                             
            .border-left {
               border-left: 1px solid black !important;
               }
            
            .upper-line {
               border-top: 1px solid black !important;
               }
               
            .upper-thinline {
               border-top: 1px solid lightgrey !important;
               }
               
            .greybgcolor {
               background-color: lightgrey;
               }

            p.ex {
				color: rgb(255,255,255);
				}
			
			h3.ex {
				color: rgb(255,255,255);
				}
			
			span.ex {
				color: rgb(255,255,255);
				}
			
			.underline {
				text-decoration: underline;
				}
			
			h4.redline {
               border-bottom: 2px solid red !important;
               }
			
           </style>
       </template>

<template id="report_invoice_document2">
    <t>
	    <div class="header">
            <div class="row">
				<div class="col-xs-2">
                	<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 100px;"/>
            	</div>
            </div>
            <div class="row"/>
            <div class="row">
 				<div class="col-xs-7">
            	<h3><strong><p t-field="o.company_id.partner_id.name"/></strong></h3>
	            	<strong><p t-field="o.company_id.partner_id" t-field-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/></strong>
	            	<p class="mt0 mb0" t-if="o.company_id.partner_id.phone">
	                	Tel: <span t-field="o.company_id.partner_id.phone"/>
	            	</p>
	            	<p class="mt0 mb0" t-if="o.company_id.partner_id.fax">
	                	Fax: <span t-field="o.company_id.partner_id.fax"/>
	            	</p>
	            	<div style="margin-top:20px;" t-field="o.company_id.rml_header1"/>
            	</div>
            	 
	       		<div class="col-xs-5">
			        <div class="row">
						<div class="col-xs-6">
	                		<div><strong><p class="mt0 mb0 border-RTB">Purchase Order No.</p></strong></div>
	                		<div><strong><p class="mt0 mb0 border-RTB">Date</p></strong></div>
	                		<div><strong><p class="mt0 mb0 border-RTB">Payment Term</p></strong></div>
	                	</div>
	                	<div>
		                    <div t-if="o.name"><p class="mt0 mb0 border-all" t-field="o.name"/></div>
		                    <div t-if="not o.name"><br/></div>
		                    <div t-if="o.date_order"><p class="mt0 mb0 border-all" t-field="o.date_order"  t-field-options='{"format": "dd/MM/yyyy"}'/></div>
		                    <div t-if="not o.date_order"><br/></div>
		                    <div t-if="o.payment_term_id.name"><p class="mt0 mb0 border-all" t-field="o.payment_term_id.name"/></div>
		                    <div t-if="not o.payment_term_id.name"><p class="ex border-all">none</p></div>
			            </div>
			        </div>
	        	</div>
	    	</div>
	    	<div class="row">
	    		<div class="col-xs-5">
	    			<strong>Vendor:</strong>
	    		</div>
	    		<div class="col-xs-5 col-xs-offset-2">
		        	<strong>Ship To:</strong>
		        </div>
		    </div>
		    <div class="row">
	    		<div class="col-xs-5 border-all">
	           		<p class="mt0 mb0" t-field="o.partner_id.name"/>
             		<p class="mt0 mb0" t-field="o.partner_id" t-field-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
					<p class="mt0 mb0" t-if="o.partner_id.phone">
			   		Tel: <span t-field="o.partner_id.phone"/>
					</p>
		           	<p class="mt0 mb0" t-if="o.partner_id.fax">
		            Fax: <span t-field="o.partner_id.fax"/>
		           	</p>
		        </div>
		        <div class="col-xs-5 col-xs-offset-2 border-all">
                    <p class="mt0 mb0" t-if="o.dest_address_id"
        				t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'>
                    	<span t-field="o.dest_address_id"/>
                    </p>

                    <p class="mt0 mb0" t-if="not o.dest_address_id and o.picking_type_id and o.picking_type_id.warehouse_id">
                        <span class="mt0 mb0" t-field="o.picking_type_id.warehouse_id.name"/>
                    <p class="mt0 mb0" t-field="o.picking_type_id.warehouse_id.partner_id"
                        t-field-options='{"widget": "contact", "fields": ["address", "phone", "fax"], "no_marker": true}'/>
                    </p>
		        </div> 
	    	</div>
        </div>
		
        <div class="page">
            <div class="oe_structure"/>
            <div class="row">
            <table class="table table-condensed">
                <thead>
                    <tr>
                    	<th class="greybgcolor">L/N</th>
                        <th class="greybgcolor">Description</th>
                        <th class="greybgcolor">U/M</th>
                        <th class="text-right greybgcolor">Ordered</th>
                        <th class="text-right greybgcolor">Unit Price</th>
                        <th class="text-right greybgcolor">Ext. Price</th>
                    </tr>
                </thead>
				<tbody class="invoice_tbody">
                    <tr t-foreach="o.order_line" t-as="l" class="kolum">
						<td width="10%" class="upper-thinline"></td>
						<td width="30%" class="upper-thinline"><span t-field="l.name"/></td>
						<td width="10%" class="upper-thinline"><span t-field="l.product_uom.name"/></td>
						<td width="10%" class="text-right upper-thinline"><span t-field="l.product_qty"/></td>
						<td width="20%" class="text-right upper-thinline">
                            <span t-field="l.price_unit"
                            	t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                        </td>
                        <td width="20%" class="text-right upper-thinline">
                            <span t-field="l.price_subtotal"
                            	t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                        </td>
                    </tr>
                </tbody>
            </table>
            </div>
            <div class="oe_structure"/>
        </div>
        
        <div class="footer">
			<div class="row signature" style="visibility:hidden;">
			<div class="row col-xs-12 upper-line"></div>		
			<div class="col-xs-6 col-xs-offset-0">
				<p t-field="o.remark" />
			</div>
						
		    <div class="col-xs-4 pull-right">
		        <table class="table table-condensed">
		            <tr>
		                <td class="border-all greybgcolor"><strong>Subtotal</strong></td>
		                <td class="text-right border-all">
		                    <span t-field="o.amount_untaxed" 
		                    		t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
		                </td>
		            </tr>
		            <tr>
		                <td class="border-all greybgcolor"><strong>Taxes</strong></td>
		                <td class="text-right border-all">
		                    <span t-field="o.amount_tax" 
		                    		t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>		                           </td>
		            </tr>
		            <tr>
		                <td class="border-all greybgcolor"><strong>Order Total</strong></td>
		                <td class="text-right border-all">
		                     <span t-field="o.amount_total"
		                     	t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
		                </td>
		            </tr>
		        </table>
		    </div>
		    
		    <div class="row mt32 mb32"/>
		    <div class="row mt32 mb32"/>
			
			<div class="row mt32 mb32">
			<div class="col-xs-2 upper-line">
				<strong>Requested by</strong>
			</div>
			<div class="col-xs-3 col-xs-offset-1 upper-line">
				<strong>Acknowledged by</strong>
			</div>
			<div class="col-xs-2 col-xs-offset-1 upper-line">
				<strong>Approved by</strong>
			</div>
			</div>
		</div>
		
		<div class="row col-xs-12 upper-line"></div>
		<div class="row">
	        <div class="col-xs-2 col-xs-offset-5">
	            <small>
	                <span>Page</span>
	                <span class="page" />
	                of
	                <span class="topage" />
	            </small>
	        </div>
	    </div>
		
		</div>
	</t>
</template>

<template id="report_invoice2">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'batam_fast_module.report_invoice_document2')"/>
        </t>
    </t>
</template>
</data>
</openerp>
